package com.jkt.rms.dataservice;

public class QueryConstants {

	public static String QRY_RATE_RESOURCE = "Select  "
			+ "qr_tbl.qry_st_dt START_DT, "
			+ "qr_tbl.qry_end_dt END_DT, "
			+ "rmsr.resource_id, "
			+ "rpl.project_id, "
			+ "rpl.eff_start_date prj_st_dt, "
			+ "rpl.eff_end_date prj_end_dt, "
			+ "rll.location_id, "
			+ "rll.eff_start_date loc_st_dt, "
			+ "rll.eff_end_date loc_end_dt, "
			+ "rrl.role_id, "
			+ "rrl.eff_start_date rl_st_dt, "
			+ "rrl.eff_end_date rl_end_dt, "
			+ "rt.rate "
			+ "From  "
			+ "(select '2010-10-01 00:00:00' qry_st_dt, '2010-10-31 00:00:00' qry_end_dt from dual) qr_tbl, "
			+ "rmsresource rmsr "
			+ "Inner join resource_project_linkup rpl on rmsr.resource_id =  rpl.resource_id "
			+ "Inner join resource_location_linkup rll on rmsr.resource_id =  rll.resource_id "
			+ "Inner join resource_role_linkup rrl on rll.resource_id =  rrl.resource_id "
			+ "Inner join rate rt on rt.vendor_id = rmsr.vendor_id and rt.role_id = rrl.role_id and rt.location_id = rll.location_id "
			+ "where rmsr.vendor_id = 99 "
			+ "and rll.eff_start_date <= rpl.eff_end_date "
			+ "and rll.eff_end_date >= rpl.eff_start_date "
			+ "and rrl.eff_start_date <= rll.eff_end_date "
			+ "and rrl.eff_end_date >= rll.eff_start_date "
			+ "and rrl.eff_start_date <= rpl.eff_end_date "
			+ "and rrl.eff_end_date >= rpl.eff_start_date "
			+ "order by rpl.eff_start_date,  rrl.eff_start_date, rll.eff_start_date ";

}
